// Code generated by ent, DO NOT EDIT.

package migrate

import (
	"entgo.io/ent/dialect/sql/schema"
	"entgo.io/ent/schema/field"
)

var (
	// ForecastsColumns holds the columns for the "forecasts" table.
	ForecastsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt64, Increment: true},
		{Name: "temperature", Type: field.TypeFloat64},
		{Name: "wind_speed", Type: field.TypeFloat64, Nullable: true},
		{Name: "precipitation_amount", Type: field.TypeFloat64, Nullable: true},
		{Name: "weather_condition", Type: field.TypeEnum, Enums: []string{"CLEAR", "CLOUDY", "RAIN", "SNOW", "FOG", "STORM"}},
		{Name: "date_time", Type: field.TypeTime},
		{Name: "forecast_region", Type: field.TypeInt64},
		{Name: "weather_forecast", Type: field.TypeInt64, Nullable: true},
	}
	// ForecastsTable holds the schema information for the "forecasts" table.
	ForecastsTable = &schema.Table{
		Name:       "forecasts",
		Columns:    ForecastsColumns,
		PrimaryKey: []*schema.Column{ForecastsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "forecasts_regions_region",
				Columns:    []*schema.Column{ForecastsColumns[6]},
				RefColumns: []*schema.Column{RegionsColumns[0]},
				OnDelete:   schema.NoAction,
			},
			{
				Symbol:     "forecasts_weathers_forecast",
				Columns:    []*schema.Column{ForecastsColumns[7]},
				RefColumns: []*schema.Column{WeathersColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "forecast_temperature_weather_condition_precipitation_amount_wind_speed",
				Unique:  false,
				Columns: []*schema.Column{ForecastsColumns[1], ForecastsColumns[4], ForecastsColumns[3], ForecastsColumns[2]},
			},
			{
				Name:    "forecast_date_time",
				Unique:  false,
				Columns: []*schema.Column{ForecastsColumns[5]},
			},
			{
				Name:    "forecast_forecast_region_weather_forecast",
				Unique:  false,
				Columns: []*schema.Column{ForecastsColumns[6], ForecastsColumns[7]},
			},
		},
	}
	// RegionsColumns holds the columns for the "regions" table.
	RegionsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt64, Increment: true},
		{Name: "name", Type: field.TypeString},
		{Name: "parent_region", Type: field.TypeString, Nullable: true},
		{Name: "latitude1", Type: field.TypeFloat64, Nullable: true},
		{Name: "longitude1", Type: field.TypeFloat64, Nullable: true},
		{Name: "latitude2", Type: field.TypeFloat64, Nullable: true},
		{Name: "longitude2", Type: field.TypeFloat64, Nullable: true},
		{Name: "osm_data", Type: field.TypeJSON, Nullable: true},
		{Name: "region_region_type", Type: field.TypeInt64, Nullable: true},
		{Name: "region_account_id", Type: field.TypeInt, Nullable: true},
	}
	// RegionsTable holds the schema information for the "regions" table.
	RegionsTable = &schema.Table{
		Name:       "regions",
		Columns:    RegionsColumns,
		PrimaryKey: []*schema.Column{RegionsColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "regions_region_types_regionType",
				Columns:    []*schema.Column{RegionsColumns[8]},
				RefColumns: []*schema.Column{RegionTypesColumns[0]},
				OnDelete:   schema.SetNull,
			},
			{
				Symbol:     "regions_users_accountId",
				Columns:    []*schema.Column{RegionsColumns[9]},
				RefColumns: []*schema.Column{UsersColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "region_name",
				Unique:  false,
				Columns: []*schema.Column{RegionsColumns[1]},
			},
			{
				Name:    "region_parent_region",
				Unique:  false,
				Columns: []*schema.Column{RegionsColumns[2]},
			},
			{
				Name:    "region_region_region_type",
				Unique:  false,
				Columns: []*schema.Column{RegionsColumns[8]},
			},
		},
	}
	// RegionTypesColumns holds the columns for the "region_types" table.
	RegionTypesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt64, Increment: true},
		{Name: "type", Type: field.TypeString, Unique: true},
	}
	// RegionTypesTable holds the schema information for the "region_types" table.
	RegionTypesTable = &schema.Table{
		Name:       "region_types",
		Columns:    RegionTypesColumns,
		PrimaryKey: []*schema.Column{RegionTypesColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "regiontype_type",
				Unique:  false,
				Columns: []*schema.Column{RegionTypesColumns[1]},
			},
		},
	}
	// UsersColumns holds the columns for the "users" table.
	UsersColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt, Increment: true},
		{Name: "email", Type: field.TypeString, Unique: true},
		{Name: "password", Type: field.TypeBytes},
		{Name: "first_name", Type: field.TypeString, Nullable: true},
		{Name: "last_name", Type: field.TypeString, Nullable: true},
	}
	// UsersTable holds the schema information for the "users" table.
	UsersTable = &schema.Table{
		Name:       "users",
		Columns:    UsersColumns,
		PrimaryKey: []*schema.Column{UsersColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "user_email_first_name_last_name",
				Unique:  false,
				Columns: []*schema.Column{UsersColumns[1], UsersColumns[3], UsersColumns[4]},
			},
		},
	}
	// WeathersColumns holds the columns for the "weathers" table.
	WeathersColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt64, Increment: true},
		{Name: "temperature", Type: field.TypeFloat64},
		{Name: "humidity", Type: field.TypeFloat64},
		{Name: "wind_speed", Type: field.TypeFloat64, Default: 0},
		{Name: "weather_condition", Type: field.TypeEnum, Enums: []string{"CLEAR", "CLOUDY", "RAIN", "SNOW", "FOG", "STORM"}},
		{Name: "precipitation_amount", Type: field.TypeFloat64, Default: 0},
		{Name: "measurement_date_time", Type: field.TypeTime},
		{Name: "weather_region", Type: field.TypeInt64, Nullable: true},
	}
	// WeathersTable holds the schema information for the "weathers" table.
	WeathersTable = &schema.Table{
		Name:       "weathers",
		Columns:    WeathersColumns,
		PrimaryKey: []*schema.Column{WeathersColumns[0]},
		ForeignKeys: []*schema.ForeignKey{
			{
				Symbol:     "weathers_regions_region",
				Columns:    []*schema.Column{WeathersColumns[7]},
				RefColumns: []*schema.Column{RegionsColumns[0]},
				OnDelete:   schema.SetNull,
			},
		},
		Indexes: []*schema.Index{
			{
				Name:    "weather_temperature_humidity_wind_speed_weather_condition_precipitation_amount",
				Unique:  false,
				Columns: []*schema.Column{WeathersColumns[1], WeathersColumns[2], WeathersColumns[3], WeathersColumns[4], WeathersColumns[5]},
			},
			{
				Name:    "weather_measurement_date_time",
				Unique:  false,
				Columns: []*schema.Column{WeathersColumns[6]},
			},
			{
				Name:    "weather_weather_region",
				Unique:  false,
				Columns: []*schema.Column{WeathersColumns[7]},
			},
		},
	}
	// Tables holds all the tables in the schema.
	Tables = []*schema.Table{
		ForecastsTable,
		RegionsTable,
		RegionTypesTable,
		UsersTable,
		WeathersTable,
	}
)

func init() {
	ForecastsTable.ForeignKeys[0].RefTable = RegionsTable
	ForecastsTable.ForeignKeys[1].RefTable = WeathersTable
	RegionsTable.ForeignKeys[0].RefTable = RegionTypesTable
	RegionsTable.ForeignKeys[1].RefTable = UsersTable
	WeathersTable.ForeignKeys[0].RefTable = RegionsTable
}
